package com.tedu;

import jdk.management.resource.ResourceType;

// 三目运算
public class Test007 {
    public static void main (String[] args) {
        //       boolean(true/false)  ?   1   :   2

        int a = 10;
        int b = 20;
        int c = 30;
        //int c = a == b ? ++a : ++b;

        //利用三目运算 求出 最大值
        System.out.println(c);

        //a b   max      max   =     max c
        int max = a > b ? a : b;
        max = max > c ? max : c;
        System.out.println(max);

        max = a > b ? (a > c ? a : c) : (b > c ? b : c);
        System.out.println(max);

    }
}
